Kubernetes for Jobseekers by Gopalakrishnan Shivakumar;
Author:Gopalakrishnan, Shivakumar; [Gopalakrishnan, Shivakumar]
Language: eng
Format: epub
Publisher: BPB Publications
Published: 2023-03-15T00:00:00+00:00
Higher availability with stable software is possible, if not for the pesky developers who want to achieve value to the customers in bug fixes and new features ð.
Blue-green deployment
For a detailed look into blue-green deployment, see https://codefresh.io/blue-green-deployments-kubernetes/. A typical blue-green deployment diagram:
Figure 7.2: Blue-green deployments
Try it
Launch the blue version by running the following:
kubectl apply -f chap-7-blue-deployment-defn.yaml
The spec has a version label to denote whether it is blue or green:
Selector:
matchLabels:
app: frontend
version: blue
Launch the service frontend with a selector to match the version: blue:
kubectl apply -f chap-7-blue-svc-defn.yaml
spec:
selector:
app: frontend
version: blue
Verify that the app works:
$ kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
frontend NodePort 10.110.95.223 <none> 8080:32575/TCP 34h
$ curl localhost:32575
<!DOCTYPE html>
â¦
Let us intentionally launch a green version that we know will fail:
Kubectl apply -f chap-7-fail-green-deployment.yaml
The spec has the version label set to green:
Selector:
matchLabels:
app: frontend
version: green
As expected, the pods are not marked as READY:
Kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx-blue-deployment-5778cb9488-4ssqj 1/1 Running 0 30s
nginx-blue-deployment-5778cb9488-68zwm 1/1 Running 0 30s
nginx-blue-deployment-5778cb9488-pf5tj 1/1 Running 0 30s
nginx-fail-green-deployment-db478459d-jfbqs 0/1 Running 0 6s
You can verify that the app still works by running curl localhost:<your service NodePort>. To ensure that the deployment is bad, let us ask the service to direct the traffic to the bad Pods:
Kubectl apply -f chap-7-green-svc-defn.yaml
Verify that the app does not work by running curl localhost:<your service NodePort>:
curl localhost:32575
curl: (52) Empty reply from server
You can see the benefit of the blue-green deployment. Even though we switched to the green deployment by mistake, we can quickly change it back to blue since we have not deleted the blue deployment:
Kubectl apply -f chap-7-blue-svc-defn.yaml
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Filmora Efficient Editing by Alexander Zacharias(5767)
The Infinite Retina by Robert Scoble Irena Cronin(5240)
Learn Wireshark - Fundamentals of Wireshark. by Lisa Bock(3965)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3933)
Edit Like a Pro with iMovie by Regit(3415)
Linux Administration Best Practices by Scott Alan Miller(2858)
Linux Command Line and Shell Scripting Techniques by Vedran Dakic & Jasmin Redzepagic(2835)
MCSA Windows Server 2016 Study Guide: Exam 70-740 by William Panek(2520)
Mastering PowerShell Scripting - Fourth Edition by Chris Dent(2390)
Docker on Windows by Stoneman Elton(2317)
Kali Linux - An Ethical Hacker's Cookbook: End-to-end penetration testing solutions by Sharma Himanshu(2312)
Creative Projects for Rust Programmers by Carlo Milanesi(2235)
Hands-On AWS Penetration Testing with Kali Linux by Karl Gilbert(2107)
Hands-On Linux for Architects by Denis Salamanca(2051)
Programming in C (4th Edition) (Developer's Library) by Stephen G. Kochan(2004)
Computers For Seniors For Dummies by Nancy C. Muir(1996)
The Old New Thing by Raymond Chen(1940)
Linux Kernel Debugging by Kaiwan N Billimoria(1762)
